package cn.imnaer.service.rest.resquest.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import cn.imnaer.service.persistence.model.SharePhotoItem;

public class SharePhotoItemParams implements Serializable {

    private String image;
    private String introduction;

    public SharePhotoItemParams() {

    }

    public String getImage() {
        return image;
    }

    public void setImage(String image) {
        this.image = image;
    }

    public String getIntroduction() {
        return introduction;
    }

    public void setIntroduction(String introduction) {
        this.introduction = introduction;
    }

    public SharePhotoItem caseToSharePhotoItem() {
        SharePhotoItem item = new SharePhotoItem();
        item.setImage(this.getImage());
        item.setIntroduction(this.getIntroduction());
        return item;
    }


    public static List<SharePhotoItem> caseToSharePhotoItems(List<SharePhotoItemParams> targets) {
        int size = targets.size();
        List<SharePhotoItem> items = new ArrayList<SharePhotoItem>(size);
        for (int i = 0; i < size; i++) {
            SharePhotoItemParams sharePhotoItemParams = targets.get(i);
            SharePhotoItem item = sharePhotoItemParams.caseToSharePhotoItem();
            items.add(item);
        }
        return items;
    }
}
